package domain

// 会话
type SseClient struct {
	// 客户端
	userId string
	// 写通道
	writeChan chan []byte
}

func (m *SseClient) Create(userId string) {
	m.userId = userId
	m.writeChan = make(chan []byte, 100)
}

func (m *SseClient) GetUserId() string {
	return m.userId
}

func (m *SseClient) GetData() chan []byte {
	return m.writeChan
}

type WsClient struct {
	// 客户端
	userId string
	// TEXT写通道
	textChan chan []byte
	// Binary写通道
	binaryChan chan []byte
	// close写通道
	closeChan chan []byte
}

func (m *WsClient) Create(userId string) {
	m.userId = userId
	m.textChan = make(chan []byte, 100)
	m.binaryChan = make(chan []byte, 100)
	m.closeChan = make(chan []byte)
}

func (m *WsClient) GetUserId() string {
	return m.userId
}

func (m *WsClient) GetTextChan() chan []byte {
	return m.textChan
}

func (m *WsClient) GetBinaryChan() chan []byte {
	return m.binaryChan
}

func (m *WsClient) GetCloseChan() chan []byte {
	return m.closeChan
}
